package com.itheima.mapper.impl;

import com.itheima.dao.UserDao;
import com.itheima.mapper.Usermapper;
import com.itheima.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class Usermapperimpl implements Usermapper {
    @Autowired
    //自动装配 依赖注入Dao
    private UserDao userDao;

    @Override
    public List<User> findAll() {
        List<User> all = userDao.findAll();
        return all;
    }

    @Override
    public User findbyid(int id) {
        User findbyid = userDao.findbyid(id);

        return findbyid;
    }

    @Override
    public int add(User user) {
        int add = userDao.add(user);
        return add;
    }

    @Override
    public int updateUser(User user) {
        return 0;
    }


    @Override
    public int deletebyid(int id) {
        int deletebyid = userDao.deletebyid(id);
        return deletebyid;
    }


}
